<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no,email=no,adress=no"/>
<title>先花花</title>
<link rel="stylesheet" type="text/css" href="css/common.css" />
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" src="script/jquery.md5.js"></script>
<script type="text/javascript" src="script/jquery.cookie.js"></script>
<script type="text/javascript" src="script/common.js"></script>
<script type="text/javascript">
  $(function(){
      storage=window.localStorage;
      bid = storage["bid"];
      $(document).on("click",".refund",function(){
        var periods = $(this).attr("periods");
        var b_id = $(this).attr("b_id");
        var money = $(this).attr("money");
        storage["periods"] = periods;
        storage["b_id"] = b_id;
        storage["money"] = money;
        window.location.href="refund.html";
      });
      $.ajax({
        url:'http://47.93.21.169/old/TP5/public/index.php/index/Borrow/getHistory',
        type:'get',
        dataType:'jsonp',
        jsonp:"callback",
        data:{
          bid:bid
        },
        success:function(result){
          if(result.status==200){
            var month = '';
            month+='<tr class="details"><td>期数</td><td>本金</td><td>利息</td><td>本金加利息</td><td>状态</td><td>操作</td></tr>';
            $.each(result.data,function(n,val){
              if(val.status=='1'){
                var c = '<input type="button" class="refund" periods='+val.periods+' b_id='+val.b_id+' money='+val.sum+' value="还款">';
              }else{
                var c = '<input type="button" disabled="disabled" value="还款">';
              }
                month+='<tr class="details"><td>'+val.periods+'</td><td>'+val.principal+'</td><td>'+val.interest+'</td><td>'+val.sum+'</td><td>'+val.status1+'</td><td>'+c+'</td></tr>';
              
              
            });
            $("#box").append(month);
          }else{
            alert(result.msg)
          }
        }
      });
  });
</script>
</script>
</head>
<body>
<!-- 页面头部 -->
<section>
  <div class="navigation-bar"> <a href="javascript:history.back(-1)" class="z-01"></a> <span>投资记录</span> <a href="index.html" class="z-02"></a> </div>
</section>
<!-- 中间内容 -->
<div class="wrapper">
  <div class="personalform">
      <div class="tzjl-tabs">
        
        <div class="tab-border"></div>
      <div class="tzjl-con1" style="min-height:150px;padding-top:100px;text-align:center;background-color:#fff; display:none">您最近还没有投资记录！ </div>
	  <div class="c-tabs-cnt c-tzjlinfo" style=" padding-bottom:60px;">
          <table style="width: 100%">
            <tbody id="box">
            </tbody>
          </table>
          <div class="clear"></div>
          <div class="addmore"><ac href="#" title="查看更多" class="btn-ckgd" id="more">查看更多↓</ac> </div>
      </div>
  </div>
  <div class="clear"></div>
</div>
<!-- 页面底部 -->
<nav class="footer border_t" id="footer"> 
  <a href="index.html" class="" id="jx"><span></span>首页</a>
   <a href="list.html" id="lc" class=""><span></span>理财</a> 
  <a href="borrow_money.html" id="jk" class=""><span></span>借款</a>
   <a href="user.html" id="cf" class="nav_on"><span></span>我的账户</a> </nav>
</body>
</html>
